﻿<!DOCTYPE html>
<html lang="zh">

<head resource>
    <meta charset="utf-8">
    <include file="../inc/meta.inc" />
    <title></title>
</head>

<body>
    <div id="vapp" v-cloak>
        <div class="toolsbar">
            <btngroup show="删除" ref='btngroup' @delete="deleteData" :selects='selects' idkey='Msg_Id'
                table="datatables">
            </btngroup>
            <query_panel :model="form" :loading="loading" @search="handleCurrentChange(1)">
                <el-form-item label="">
                    <el-input v-model="form.search" clearable style="width:100px"
                        @keyup.enter.native="handleCurrentChange(1)" @clear="handleCurrentChange(1)"
                        :disabled="loading"></el-input>
                </el-form-item>
            </query_panel>

        </div>
        <el-table ref="datatables" :data="datas" :stripe="true" tooltip-effect="dark" style="width: 100%"
            @row-dblclick="modify_show" v-loading="loading" @selection-change="val=>selects=val" row-key="Msg_Id"
            cell-class-name="tdcell">
            <el-table-column type="selection" width="35" show-overflow-tooltip>
            </el-table-column>
            <el-table-column type="index" width="50" align="center">
                <template slot-scope="scope">
                    <span>{{(form.index - 1) * form.size + scope.$index + 1}}</span>
                </template>
            </el-table-column>

            <el-table-column label="留言">
                <div slot-scope="scope" class="title_box" :title="scope.row.Cou_Name">
                    {{scope.row.Msg_Context}}
                </div>
            </el-table-column>
            <el-table-column label="学员" width="100" align="center">
                <div slot-scope="scope" class="title_box" :title="scope.row.Cou_Name">
                    {{scope.row.Ac_Name}}
                </div>
            </el-table-column>
            <el-table-column label="时间" width="150">
                <div slot-scope="scope" class="title_box" :title="scope.row.Cou_Name">
                    {{scope.row.Msg_CrtTime|date('yyyy-MM-dd HH:mm:ss')}}
                </div>
            </el-table-column>
            <el-table-column label="显示" width="60">
                <template slot-scope="scope">
                    <span class="el-icon-loading" v-show="loadingid==scope.row.Msg_Id"></span>
                    <div>
                        <el-switch v-model="scope.row.Msg_Del" @change="changeState(scope.row)" active-color="#ff4949"
                            inactive-color="#13ce66" v-show="loadingid!=scope.row.Msg_Id">
                        </el-switch>
                    </div>
                </template>
            </el-table-column>
            <el-table-column label="操作" show-overflow-tooltip width="120">

                <el-button-group slot-scope="scope">
                    <el-link type="primary" plain icon="el-icon-edit" @click='modify_show(scope.row)'>
                        修改
                    </el-link>
                    <el-popconfirm confirm-button-text='是的' cancel-button-text='不用' icon="el-icon-info" icon-color="red"
                        title="确定删除吗？" @confirm="$refs.btngroup.delete(scope.row.Msg_Id)">
                        <el-link type="danger" plain icon="el-icon-delete" slot="reference">删除
                        </el-link>
                    </el-popconfirm>
                </el-button-group>
            </el-table-column>
        </el-table>

        <div id="pager-box" v-if="datas.length>0">
            <el-pagination v-on:current-change="handleCurrentChange" :current-page="form.index" :page-sizes="[1]"
                :page-size="form.size" :pager-count="12" layout="total, prev, pager, next, jumper" :total="total">
            </el-pagination>
        </div>
        <!-- 编辑-->
        <el-dialog title="提示" :visible.sync="modifyVisible" width="60%">
            <span slot="title">
                <icon>&#xe817</icon>编辑信息
            </span>
            <el-form ref="modifyObj" :model="modifyObj" label-width="80px" :rules="rules" v-on:submit.native.prevent>
                <el-form-item label="留言" prop="Msg_Context">
                    <el-input v-model="modifyObj.Msg_Context" clearable type="textarea" :rows="3"></el-input>
                </el-form-item>
                <el-form-item label="时间">
                    {{modifyObj.Msg_CrtTime|date('yyyy-MM-dd HH:mm:ss')}}
                </el-form-item>
                <el-form-item label="学员">
                    {{modifyObj.Ac_Name}}
                    ( {{modifyObj.Ac_AccName}})
                </el-form-item>
            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="modifyVisible = false">取 消</el-button>
                <el-button type="primary" @click="btnSave('modifyObj')">确 定</el-button>
            </span>
        </el-dialog>
    </div>
</body>

</html>